package pokerserver.core;

import common.GameAction;
import common.TrunkatedPlayer;

import pokerserver.core.network.ServerThread;

/**
 * Interface for the player class.
 * 
 * @author Aron Manucheri
 * 
 */
public interface IPlayer {

	/**
	 * 
	 * @return the nickname of the player
	 */
	String getNickName();

	/**
	 * Sets a thread associated with the player.
	 * 
	 * @param playerThread
	 *            the thread you want to associate to the player
	 */
	void setPlayerThread(ServerThread playerThread);

	/**
	 * 
	 * @param amountInPot
	 *            the amount this player has in the pot
	 */
	void setAmountInPot(int amountInPot);

	/**
	 * Used when doing a bet/call/allin. Increases the currentplayers amount in
	 * pot. Essentially does the same thing as "setAmountInPot", except it
	 * increases the value instead.
	 * 
	 * @param bet
	 *            the amount to increase the pot with
	 */
	void increaseAmountInPot(int bet);

	/**
	 * Sets the position of the player.
	 * 
	 * @param position
	 *            the position to set
	 */
	void setPosition(int position);

	/**
	 * 
	 * @return the position of the player
	 */
	int getPosition();

	/**
	 * 
	 * @return the current player's amount in the pot
	 */
	int getAmountInPot();

	/**
	 * 
	 * @param amount
	 *            value to set in stack
	 */
	void setStack(int amount);

	/**
	 * 
	 * @return the player's hand
	 */
	Hand getHand();

	/**
	 * 
	 * @param hand
	 *            the hand to set to this player
	 */
	void setHand(Hand hand);

	/**
	 * 
	 * @param status
	 *            set if the player has folded or not
	 */
	void setFolded(boolean status);

	/**
	 * 
	 * @return true if player is folded, false if not.
	 */
	boolean isFolded();

	/**
	 * 
	 * @param nickName
	 *            sets the player's nickname
	 */
	void setNickName(String nickName);
	
	/**
	 * 
	 * @return the value of the player's stack
	 */
	int getStack();

	/**
	 * 
	 * @param action the action to set for this player
	 */
	void setAction(GameAction action);

	/**
	 * 
	 * @return get the players gameaction
	 */
	GameAction getAction();

	/**
	 * 
	 * @return the thread associated with this player
	 */
	ServerThread getPlayerThread();
	
	/**
	 * 
	 * @return a TrunkatedPlayer with all relevant information about this player.
	 */
	public TrunkatedPlayer generateTrunkPlayer();
	
}
